<!--关联设备-->
<template>
  <div class="ele-body">
    <a-divider orientation="left">已关联的设备列表</a-divider>
    <a-table :columns="linkDeviceColumns" :data-source="linkDeviceList" :pagination="false" bordered />
  </div>

</template>

<script>
import {DeviceSinkGatewayLinksApi} from "@/api/property/DeviceSinkGatewayLinksApi";
export default {
  name: 'DeviceSinkGatewayLinkDevice',
  components: {
  },
  props: {
    data: Object
  },
  async mounted() {
  },
  async created() {
    this.getLinkDeviceList();
  },
  data() {
    return {
      //已关联设备
      linkDeviceColumns : [
        {
          title: '时间',
          dataIndex: 'createTime'
        },
        {
          title: '关联设备号',
          dataIndex: 'recordNo'
        }
      ],
      linkDeviceList : []
    };
  },
  methods: {

    getLinkDeviceList() {
      let that = this;
      DeviceSinkGatewayLinksApi.list({"gatewayNo" : this.data.recordNo}).then(resp => {
        that.linkDeviceList = resp || [];
        console.log(that.linkDeviceList);
      });
    }

  }
};
</script>
